//
//  RNOLMyRewardsViewController.m
//  RongNiuOnline
//
//  Created by apple on 2018/4/24.
//  Copyright © 2018年 rongniu. All rights reserved.
//

#import "RNOLMyRewardsViewController.h"
#import "RNOLMyRedBagViewController.h"
#import "RNOLGiftCertificateViewController.h"

@interface RNOLMyRewardsViewController ()


@end


@implementation RNOLMyRewardsViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    [self setupNavBarTitleViewWithText:@"我的奖励"];
    [self setupNavBarRightButtonWithTitle:@"规则"];
    [RNOLLoginTool setNavgationBarNeedAnimation:YES];
    self.view.backgroundColor = kBgColor;
    self.minYPullUp = 0;
}

#pragma mark- 规则
- (void)navRightAction:(UIButton *)button{
    NSLog(@"规则");
}


/**
 控制器继承 SPCoverController
 此方法返回的是标题栏 标题
 */
- (NSString *)titleForIndex:(NSInteger)index
{
    return @[@"我的红包",@"我的礼券"][index];
}

- (CGFloat)tabWidthForIndex:(NSInteger)index{
    return KWIDTH/2.0;
}

- (CoverScrollStyle)preferCoverStyle{
    return CoverScrollStyleTop;
}

/**
 下面联动的ChildController控制器的数量
 */
- (NSInteger)numberOfControllers
{
    return 2;
}

- (CGFloat)preferTabY{
    return 0 ;
}

/**
 下面联动的ChildController控制器
 */
- (UIViewController *)controllerAtIndex:(NSInteger)index
{
    RNOLMyRedBagViewController *myRedBagVC = [[RNOLMyRedBagViewController alloc] init];    
    RNOLGiftCertificateViewController *myGiftVC = [[RNOLGiftCertificateViewController alloc] init];
    
    return @[myRedBagVC,myGiftVC][index];
}

//页面切换已在SPTabcontroller 实现
- (void)didPressTabForIndex:(NSInteger)index{
    [super didPressTabForIndex: index];
    
}

//横向滑动
- (void)scrollViewContentOffsetWithRatio:(CGFloat)ratio draging:(BOOL)draging{
    [super scrollViewContentOffsetWithRatio:ratio draging:draging];
    

}


@end
